<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>滑州美食 - 印象滑州网</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        :root {
            --primaryBlue: #007BFF;
            --secondaryBlue: #0056b3;
            --lightBlue: #e7f5ff;
            --starBlue: #2A4359;
            --ink: #333333;
            --jade: #F7FBFE;
            --autumnBlue: #8AA2B5;
            --glazeBlue: #3A5F7D;
            --paleBlueGrey: #E1E8ED;
            --stoneGreen: #5C877B;
            --bambooGreen: #7A9D8F;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
            line-height: 1.6;
            color: var(--ink);
            background-color: var(--jade);
        }

        /* 导航栏样式 */
        .nav-container {
            background-color: rgba(247, 251, 254, 0.95);
            padding: 1.2rem 3rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 20px rgba(0,0,0,0.05);
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .logo-icon {
            width: 80px;
            height: 80px;
            background: transparent;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .logo-icon img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .logo h1 {
            color: var(--starBlue);
            font-size: 1.8rem;
            font-weight: 600;
            letter-spacing: 1px;
            background: linear-gradient(45deg, var(--primaryBlue), var(--glazeBlue));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .nav-links {
            display: flex;
            list-style: none;
            gap: 2.5rem;
        }

        .nav-links a {
            color: var(--starBlue);
            text-decoration: none;
            font-size: 1.1rem;
            padding: 0.5rem 1rem;
            border-radius: 4px;
            transition: all 0.3s ease;
            position: relative;
        }

        .nav-links a::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 0;
            height: 2px;
            background: linear-gradient(90deg, var(--primaryBlue), var(--bambooGreen));
            transition: all 0.3s ease;
            transform: translateX(-50%);
        }

        .nav-links a:hover::after,
        .nav-links a.active::after {
            width: 100%;
        }

        .nav-links a:hover,
        .nav-links a.active {
            color: var(--primaryBlue);
        }

        /* 美食展示区域样式 */
        .food-hero {
            height: 60vh;
            background: linear-gradient(135deg, var(--starBlue), var(--glazeBlue));
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: var(--jade);
            margin-top: 80px;
            position: relative;
            overflow: hidden;
        }

        .food-hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('https://t8.baidu.com/it/u=269265582,2428879891&fm=193') center/cover;
            opacity: 0.3;
        }

        .food-hero-content {
            position: relative;
            z-index: 1;
        }

        .food-hero h2 {
            font-size: 3.5rem;
            margin-bottom: 1rem;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }

        .food-hero p {
            font-size: 1.5rem;
            max-width: 800px;
            margin: 0 auto;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
        }

        .food-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
            padding: 4rem 2rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        .food-card {
            background: var(--jade);
            border-radius: 5px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05);
            transition: all 0.3s ease;
        }

        .food-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 40px rgba(0,0,0,0.1);
        }

        .food-image {
            width: 100%;
            height: 250px;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .food-card:hover .food-image {
            transform: scale(1.05);
        }

        .food-content {
            padding: 1.5rem;
        }

        .food-title {
            color: var(--starBlue);
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
            font-weight: 600;
        }

        .food-description {
            color: var(--autumnBlue);
            font-size: 1rem;
            margin-bottom: 1rem;
        }

        .food-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 1rem;
        }

        .food-tag {
            background: var(--lightBlue);
            color: var(--primaryBlue);
            padding: 0.3rem 0.8rem;
            border-radius: 20px;
            font-size: 0.9rem;
        }

        .food-details {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--paleBlueGrey);
        }

        .food-detail-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--autumnBlue);
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
        }

        .food-detail-item i {
            color: var(--primaryBlue);
        }

        /* 页脚样式 */
        footer {
            background: linear-gradient(135deg, var(--starBlue), var(--glazeBlue));
            color: var(--jade);
            padding: 3rem 2rem;
            text-align: center;
        }

        .footer-content p {
            font-size: 1rem;
            opacity: 0.8;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .nav-container {
                padding: 1rem;
                flex-direction: column;
            }

            .nav-links {
                margin-top: 1rem;
                flex-direction: column;
                align-items: center;
                gap: 1rem;
            }

            .food-hero h2 {
                font-size: 2.5rem;
            }

            .food-hero p {
                font-size: 1.2rem;
            }

            .food-grid {
                padding: 2rem 1rem;
            }
        }
    </style>
</head>
<body>
    <header>
        <nav class="nav-container">
            <div class="logo">
                <div class="logo-icon">
                    <img src="hz.png" alt="滑州网logo">
                </div>
                <h1>印象滑州网</h1>
            </div>
            <ul class="nav-links">
                <li><a href="index.html">首页</a></li>
                <li><a href="food.html" class="active">美食介绍</a></li>
                <li><a href="scenery.html">景点介绍</a></li>
                <li><a href="culture.html">民俗文化</a></li>
                <li><a href="message.html">在线留言</a></li>
            </ul>
        </nav>
    </header>

    <main>
        <section class="food-hero">
            <div class="food-hero-content">
                <h2>滑州美食</h2>
                <p>品味地道滑州美食，感受舌尖上的文化传承</p>
            </div>
        </section>

        <section class="food-grid" id="foodGrid">
            <!-- 美食卡片将通过JavaScript动态加载 -->
        </section>
    </main>

    <footer>
        <div class="footer-content">
            <p>&copy; 2025 印象滑州网 版权所有</p>
        </div>
    </footer>

    <script>
        // 获取美食数据并渲染
        async function loadFoodData() {
            try {
                const response = await fetch('http://localhost:3000/foods');
                const foods = await response.json();
                const foodGrid = document.getElementById('foodGrid');
                
                foods.forEach(food => {
                    const foodCard = `
                        <div class="food-card">
                            <img src="${food.image}" alt="${food.name}" class="food-image">
                            <div class="food-content">
                                <h3 class="food-title">${food.name}</h3>
                                <p class="food-description">${food.description}</p>
                                <div class="food-tags">
                                    ${food.tags.map(tag => `<span class="food-tag">${tag}</span>`).join('')}
                                </div>
                                <div class="food-details">
                                    <div class="food-detail-item">
                                        <i class="fas fa-map-marker-alt"></i>
                                        <span>推荐地点：${food.location}</span>
                                    </div>
                                    <div class="food-detail-item">
                                        <i class="fas fa-clock"></i>
                                        <span>最佳品尝时间：${food.bestTime}</span>
                                    </div>
                                    <div class="food-detail-item">
                                        <i class="fas fa-star"></i>
                                        <span>推荐指数：${food.rating}</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    `;
                    foodGrid.innerHTML += foodCard;
                });
            } catch (error) {
                console.error('加载美食数据失败:', error);
            }
        }

        // 页面加载完成后执行
        document.addEventListener('DOMContentLoaded', loadFoodData);
    </script>
</body>
</html>

